/* 通用布局样式 */
.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 认证页面样式 */
.auth-container {
  width: 100%;
  max-width: 400px;
  margin: 50px auto;
  padding: 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.auth-container form {
  display: flex;
  flex-direction: column;
}

.auth-container input {
  padding: 12px 15px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.auth-container button {
  background-color: #4f46e5;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
}

.auth-container button:hover {
  background-color: #4338ca;
}

.auth-container p {
  text-align: center;
  margin-top: 20px;
}

/* 文档列表页面样式 */
.documents-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
}

.documents-container .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.create-button {
  background-color: #4f46e5;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.create-button:hover {
  background-color: #4338ca;
}

.document-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.document-card {
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.document-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.document-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
  cursor: pointer;
}

.document-card .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.delete-button {
  background-color: #ef4444;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.delete-button:hover {
  background-color: #dc2626;
}

/* 编辑器页面样式 */
.editor-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.title-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 18px;
  font-weight: 500;
  margin-right: 15px;
  height: 48px;
  box-sizing: border-box;
}

.md-editor {
  margin-bottom: 20px;
  border-radius: 4px;
  overflow: hidden;
}

.share-button{
  background-color: #288a39;
  color: white;
  padding: 12px 16px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
  height: 48px;
  box-sizing: border-box;
}

.export-button{
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 16px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
  height: 48px;
  box-sizing: border-box;
}

.export-menu button{
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 3px 4px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  
  box-sizing: border-box;
}

.save-button{
  background-color: #4f46e5;
  color: white;
  padding: 12px 16px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
  height: 48px;
  box-sizing: border-box;
}

.save-button:hover {
  background-color: #4338ca;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .documents-container, .editor-container, .profile-container {
    padding: 15px;
    max-width: 100%;
  }
  
  .document-list {
    grid-template-columns: 1fr;
  }
  
  .editor-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .title-input {
    margin-right: 0;
    width: 100%;
  }
  
 
  
  .header-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .header h2 {
    margin-bottom: 15px;
  }
  
  /* 手机视图下的顶部栏样式 */
  .top-bar {
    padding: 5px 0;
    margin-bottom: 15px;
  }
  
  .logout-button {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  /* 手机视图下的工具栏样式调整 */
  .large-toolbar .w-md-editor-toolbar {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 5px 0 !important;
  }
  
  .large-toolbar .w-md-editor-toolbar ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
  }
  
  .large-toolbar .w-md-editor-toolbar ul li button {
    height: 36px !important;
    width: 36px !important;
    font-size: 16px !important;
  }
  
  /* 手机视图下的下拉菜单位置修正 */
  .large-toolbar .w-md-editor-toolbar-child {
    position: fixed !important;
    top: 150px !important; /* 确保下拉菜单显示在可见区域 */
    left: 10px !important;
    right: 10px !important;
    width: calc(100% - 20px) !important;
    max-width: none !important;
    z-index: 1000 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
  }
  
  /* 在移动设备上确保header下拉菜单也能正确显示 */
  .large-toolbar button[data-name="header"] + .w-md-editor-toolbar-child {
    left: 10px !important;
    right: 10px !important;
    width: calc(100% - 20px) !important;
    min-width: auto !important;
  }
  
  /* 增强移动设备下拉菜单中按钮的可触摸性 */
  .large-toolbar .w-md-editor-toolbar-child button {
    padding: 12px !important;
    font-size: 16px !important;
  }
  
  /* 个人资料页面的移动端样式 */
  .profile-header {
    flex-direction: column;
    gap: 10px;
  }
  
  .back-button {
    width: 100%;
  }
  
  .profile-section {
    padding: 15px;
  }
  
  .form-group input {
    font-size: 14px;
  }
}

/* 消息提示 */
.message {
  padding: 10px 15px;
  margin: 15px auto;
  width: 90%;
  max-width: 600px;
  border-radius: 5px;
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

.success {
  background-color: #e8f5e9;
  color: #388e3c;
  border: 1px solid #c8e6c9;
}

.error {
  background-color: #ffebee;
  color: #d32f2f;
  border: 1px solid #ffcdd2;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 导入按钮样式 */
.header-buttons {
  display: flex;
  gap: 10px;
}

.import-button {
  background-color: #10b981;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.import-button:hover {
  background-color: #059669;
}

/* 增强编辑器样式 */
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}

.editor-toolbar-wrapper {
  /* 覆盖MD编辑器的默认样式 */
}

.md-editor.large-toolbar {
  font-size: 16px !important;
}

/* 增大工具栏按钮 */
.large-toolbar .w-md-editor-toolbar {
  
  padding: 5px !important;
}
.large-toolbar .w-md-editor-toolbar ul li div div ul li button
{
  height: 40px !important;
  width: 70px !important;
  font-size: 18px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.large-toolbar .w-md-editor-toolbar ul li button {
  height: 40px !important;
  width: 40px !important;
  font-size: 18px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.large-toolbar .w-md-editor-toolbar ul li button svg {
  width: 20px !important;
  height: 20px !important;
}

/* 工具栏提示样式 */
.large-toolbar .w-md-editor-toolbar ul li button[data-name]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
}

/* 修复下拉菜单样式 */
.large-toolbar .w-md-editor-toolbar-child {
  min-width: 80px !important;
  position: absolute !important;
  top: 100% !important; /* 确保下拉框紧贴在按钮下方 */
  left: 0 !important;
  margin-top: 0 !important;
  padding: 0 !important;
  z-index: 1000 !important; /* 增加z-index确保下拉菜单显示在其他元素之上 */
  border: 1px solid #d9d9d9 !important;
  border-radius: 4px !important;
  background-color: white !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* 删除通过属性选择器的控制方式，让MDEditor组件自己控制下拉菜单的显示和隐藏 */

.large-toolbar .w-md-editor-toolbar-child button {
  padding: 8px 12px !important;
  font-size: 14px !important;
  width: 100% !important;
  text-align: left !important;
  display: block !important; /* 确保按钮显示为块级元素 */
  border: none !important;
  background: none !important;
  cursor: pointer !important;
  color: #333 !important;
}

.large-toolbar .w-md-editor-toolbar-child button:hover {
  background-color: #f5f5f5 !important;
}

/* 确保标题按钮的子菜单位置正确 */
.large-toolbar .w-md-editor-toolbar > ul > li {
  position: relative !important;
}

/* 强化标题按钮的样式，提供更明显的视觉反馈 */
.large-toolbar .w-md-editor-toolbar button[data-name="header"] {
  background-color: #f0f0f0 !important;
}

.large-toolbar .w-md-editor-toolbar button[data-name="header"]:hover,
.large-toolbar .w-md-editor-toolbar button[data-name="header"]:focus {
  background-color: #e0e0e0 !important;
}

/* 增强header下拉菜单的显示效果 */
.large-toolbar button[data-name="header"] + .w-md-editor-toolbar-child {
  left: 0 !important;
  right: auto !important;
  min-width: 180px !important;
  border: 1px solid #ccc !important;
}

/* 顶部栏和退出按钮样式 */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 20px;
}

.logout-button {
  background-color: #ef4444;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logout-button:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* 用户头像样式 */
.user-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.user-avatar-small:hover {
  transform: scale(1.05);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background-color: #4f46e5;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 18px;
}

/* 个人资料页面样式 */
.profile-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.back-button {
  background-color: #6b7280;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.back-button:hover {
  background-color: #4b5563;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.profile-section {
  background-color: white;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-section h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 18px;
  color: #333;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 10px;
}

.avatar-section {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.avatar-img-large {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder-large {
  width: 100%;
  height: 100%;
  background-color: #4f46e5;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 36px;
}

.avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px;
  font-size: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.avatar-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.user-info {
  margin-top: 20px;
}

.info-item {
  margin-bottom: 15px;
}

.info-item label {
  display: block;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 4px;
}

.info-item p {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 4px;
}

.form-group input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 16px;
}

.change-password-button {
  background-color: #4f46e5;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.2s;
}

.change-password-button:hover {
  background-color: #4338ca;
}

/* 邮箱验证码区样式 */
.email-verification {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.email-verification input {
  flex: 1;
  margin-bottom: 0;
}

.verification-button {
  background-color: #10b981;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0 15px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.verification-button:hover {
  background-color: #059669;
}

.verification-button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

/* 忘记密码页面样式 */
.reset-button {
  background-color: #4f46e5;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
}

.reset-button:hover {
  background-color: #4338ca;
}

.reset-button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.verification-info {
  margin: 10px 0 20px;
  padding: 10px;
  background-color: #f3f4f6;
  border-radius: 4px;
  font-size: 14px;
  color: #4b5563;
  text-align: center;
}

.verification-info strong {
  color: #111827;
}

.countdown {
  margin-left: 5px;
  color: #4f46e5;
}

.resend-button {
  background: none;
  border: none;
  color: #4f46e5;
  cursor: pointer;
  margin-left: 10px;
  font-size: 14px;
  text-decoration: underline;
}

.resend-button:disabled {
  color: #9ca3af;
  cursor: not-allowed;
  text-decoration: none;
}

.auth-links {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

/* 最近打开的文档列表样式 */
.recent-documents-section {
  margin: 30px 0;
  padding: 20px;
  background-color: #f9fafb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recent-documents-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #4b5563;
  font-size: 18px;
  font-weight: 600;
}

.recent-document-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-document-card {
  background-color: white;
  border-radius: 6px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  border-left: 4px solid #4f46e5;
}

.recent-document-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.recent-document-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.recent-document-header h4 {
  margin: 0;
  color: #1f2937;
  font-size: 16px;
  font-weight: 600;
}

.recent-document-date {
  font-size: 12px;
  color: #6b7280;
}

.recent-document-summary {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.no-documents {
  text-align: center;
  color: #6b7280;
  padding: 20px;
  font-style: italic;
}

/* 响应式样式 */
@media (max-width: 768px) {
  .recent-documents-section {
    padding: 15px;
    margin: 20px 0;
  }
  
  .recent-document-card {
    padding: 12px;
  }
  
  .recent-document-header h4 {
    font-size: 15px;
  }
}

.recent-document-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.delete-button.small {
  font-size: 12px;
  padding: 3px 8px;
  background-color: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 4px;
  opacity: 0.7;
  transition: all 0.2s;
}

.delete-button.small:hover {
  opacity: 1;
  background-color: #fef2f2;
}

.recent-document-card h4,
.recent-document-card p {
  cursor: pointer;
}

.recent-document-card h4:hover {
  color: #4f46e5;
}

/* 分享模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-header {
  margin-bottom: 15px;
}

.modal-header h3 {
  margin: 0;
  color: #333;
}

.share-link-container {
  margin-bottom: 20px;
}

.share-link-input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.share-copy-button {
  background-color: #1890ff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.share-copy-button:hover {
  background-color: #40a9ff;
}

.share-copy-button:active, .share-copy-button.active {
  background-color: #096dd9;
  transform: scale(0.96);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* 移动设备上的分享模态框样式 */
@media (max-width: 768px) {
  .modal {
    width: 95%;
    padding: 15px;
  }
  
  .share-link-container {
    display: flex;
    flex-direction: column;
  }
  
  .share-link-input {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 14px;
  }
  
  .share-copy-button {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    margin-bottom: 5px;
    touch-action: manipulation; /* 优化移动设备触摸行为 */
    -webkit-tap-highlight-color: transparent; /* 移除iOS上的点击高亮 */
  }
  
  .share-copy-button:active, .share-copy-button.active {
    background-color: #096dd9;
    transform: scale(0.96);
  }
} 